package com.yangcb.workrecord.concurrent.controller;

import com.yangcb.workrecord.concurrent.pool.ThreadPoolManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * ${DESCRIPTION}
 *
 * @author yangcb
 * @create 2017-09-28 14:57
 **/

@Controller
public class ThreadPoolController {
    @Autowired
    ThreadPoolManager tpm;
    @RequestMapping("/pool")
    @ResponseBody
    public String test() {
        for (int i = 0; i < 500; i++) {
            //模拟并发500条记录
            tpm.processOrders(Integer.toString(i)+System.currentTimeMillis());
        }
        return "ok";
    }

}
